home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-07-25 | 668 b | 57 lines | [TEXT/KAHL] |
- strlen(s)
- register char *s;
- {
- register int len;
-
- for (len = 0; *s; ++len, ++s);
- return len;
- }
-
- strcpy(to, from)
- register char *to, *from;
- {
- while (*to = *from)
- ++to, ++from;
- }
-
- ctopcpy(pstr, cstr)
- register char *pstr, *cstr;
- {
- register int size = 0;
- register char *p = pstr++;
-
- while (*cstr)
- *pstr = *cstr, ++cstr, ++pstr, ++size;
-
- *p = size;
- }
-
- ptoccpy(cstr, pstr)
- register char *cstr, *pstr;
- {
- register int size = *pstr++;
-
- while (size--)
- *cstr = *pstr, ++cstr, ++pstr;
-
- *cstr = '\0';
- }
-
- atoi(s)
- char *s;
- {
- int n = 0;
- char c;
-
- while (c = *s++)
- {
- if ('0' <= c && c <= '9')
- n = n * 10 + (c - '0');
- else
- break;
- }
-
- return n;
- }
-
-